home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / verifyWorkspaceFileRule.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  1.7 KB  |  45 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Cloning Date:  April 2002
  22. //  Author:        MW
  23. //
  24. //  Description:
  25. //        If the passed-in fileRule/location combination
  26. //        is not part of the current workspace's fileRuleList,
  27. //        add it.  Then, save the workspace so the new rule is
  28. //        available in the project the next time Maya is
  29. //        started.  (If the workspace is NOT saved, file->open
  30. //        maya not know where to look for certain types of files
  31. //        it requires.)
  32. //        
  33. //        Note if the fileRule already exists with a different
  34. //        location, calling this method will NOT override the
  35. //        exsting rule.
  36. //        
  37. global proc verifyWorkspaceFileRule( string $fileRule, string $location )
  38. {
  39.     string $ruleLocation = `workspace -fileRuleEntry $fileRule`;
  40.     if( size( $ruleLocation ) == 0 ) {
  41.         workspace -fileRule $fileRule $location;
  42.         workspace -saveWorkspace;
  43.     }
  44. }
  45.